<template>
    <div class="header-bar" >
        <slot name="logo"></slot>
        <sider-trigger :collapsed="collapsed" icon="md-menu" @on-change="handleCollpasedChange"></sider-trigger>
        <div class="custom-content-con">
            <slot></slot>
        </div>
    </div>
</template>
<script>
import siderTrigger from './sider-trigger'
import './header-bar.less'
export default {
    name: 'HeaderBar',
    components: {
        siderTrigger
    },
    props: {
        collapsed: Boolean
    },
    methods: {
        handleCollpasedChange (state) {
            this.$emit('on-coll-change', state)
        },
        goHome () {
            console.log(this.$store.state.user.roleType)
            let roleType = this.$store.state.user.roleType
            if (roleType == 4) {
                this.$router.push({
                    path: '/student'
                })
            }
        }
    }
}
</script>
